import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import { loadEnv } from "vite";
// https://vitejs.dev/config/

export default ({ mode }) => {
  return defineConfig({
    plugins: [uni()],
    server: {
      assetsPublicPath: "/",
      hmr: true,
      host: "0.0.0.0",
      port: "925",
      proxy: {
        "/api": {
          target: "http://58.215.18.179:28012", //后端接口地址
          ws: true, //接受websocket请求
          changeOrigin: true, //是否允许跨越
          chunkOrigins: true,
          pathRewrite: {
            // "^/api": "api", //重写,
          },
        },
      },
    },
  });
};
